<div [@routerTransition] id="techfilePDialogBox">


  <div class="m-subheader ">
    <div class="row align-items-center">
      <div class="mr-auto col-auto">
        <h3 class="m-subheader__title m-subheader__title--separator">
          <span>借阅管理</span>
        </h3>
        <span class="m-section__sub">
          借阅文件信息管理
        </span>
      </div>
      <div class="col text-right mt-3 mt-md-0">
        <div class="btn-group dropdown mr-2" dropdown>
          <button dropdownToggle class="dropdown-toggle btn btn-outline-success">
            <i class="far fa-file-excel"></i><span class="caret"></span> Excel操作
          </button>
          <ul class="dropdown-menu dropdown-menu-right dropdown-excel-operations" *dropdownMenu>
            <li>
              <a href="javascript:;" (click)="exportToExcel()">
                <i class="fa fa-download"></i>
                {{'ExportToExcel' | localize}}
              </a>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>

  <div class="m-content">
    <div class="m-portlet m-portlet--mobile">
      <div class="m-portlet__body">
        <div class="m-form m-form--label-align-right">
          <form class="horizontal-form" (ngSubmit)="getTabsProduction()">
            <div class="row align-items-center m--margin-bottom-10">
              <div class="col-xl-12">
                <div class="form-group m-form__group align-items-center">
                  <div class="input-group">
                    <input [(ngModel)]="filterText" name="filterText" autofocus class="form-control m-input"
                      [placeholder]="l('SearchWithThreeDot')" type="text" />
                    <span class="input-group-btn">
                      <button (click)="reloadPage()" class="btn btn-primary" type="submit">
                        <i class="flaticon-search-1" [attr.aria-label]="l('Search')"></i>
                      </button>
                    </span>
                  </div>
                </div>
              </div>
            </div>

            <div [hidden]="!advancedFiltersAreShown">

              <selectLocation #sele [(location)]="positionId"></selectLocation>

              <div class="row m--margin-bottom-10">
                <div class="col-md-4">
                  <div class="form-group">
                    <select #techFileInfoTypeCombobox name="sourceName" class="form-control bs-select" title="选择类型"
                      [(ngModel)]="filetype">
                      <option value="0">{{emptyText}}</option>
                      <option *ngFor="let Item of filetypes" [value]="Item.value">
                        {{Item.displayText}}
                      </option>
                    </select>
                  </div>
                </div>

                <div class="col-md-4">
                  <div class="form-group">
                    <select #stageTypeCombobox name="sourceName" class="form-control bs-select" title="选择阶段"
                      [(ngModel)]="stage">
                      <option value="0">{{emptyText}}</option>
                      <option *ngFor="let Item of stages" [value]="Item.value">
                        {{Item.displayText}}</option>
                    </select>
                  </div>
                </div>
                <div class="col-md-4">
                  <div class="form-group">
                    <select #securityTypeCombobox name="sourceName" class="form-control bs-select" title="选择密级"
                      [(ngModel)]="security">
                      <option value="0">{{emptyText}}</option>
                      <option *ngFor="let Item of securitys" [value]="Item.value">
                        {{Item.displayText}}
                      </option>
                    </select>
                  </div>
                </div>
              </div>
              <div class="row m--margin-bottom-10">
                <div class="col-md-4">
                  <div class="form-group">
                    <date-range-empty-picker placeholder="选择日期范围" [(startDate)]="startFilterDate"
                      [(endDate)]="endFilterDate"></date-range-empty-picker>
                  </div>
                </div>
              </div>
            </div>
            <div class="row m--margin-bottom-10">
              <div class="col-sm-6">
                <span class="clickable-item text-muted" *ngIf="!advancedFiltersAreShown"
                  (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i class="fa fa-angle-down"></i>
                  显示更多</span>
                <span class="clickable-item text-muted" *ngIf="advancedFiltersAreShown"
                  (click)="advancedFiltersAreShown=!advancedFiltersAreShown"><i class="fa fa-angle-up"></i> 收起</span>
              </div>
            </div>
          </form>
        </div>
        <tabset class="tab-container tabbable-line">
          <tab (select)="onSelect(0)" customClass="m-tabs__item">
            <span *tabHeading>
              已接收 &nbsp;<span class='m-badge m-badge--success'>
                {{tabsMaxCount[0]}}
              </span>
            </span>
            <div class="row margin-bottom-10 ">
              <div class="col-sm-6 text-left">
                <button type="button" class="btn btn-success"
                  [disabled]="!selectedProductsupdate || !selectedProductsupdate.length"
                  (click)="UpdateSelectedTechfile()"><i class="fa flaticon-edit-1"></i> 修改
                </button>

                <button type="button" (click)="SelectedTechfileVoid()"
                  [disabled]="!selectedProductsupdate || !selectedProductsupdate.length" class="btn btn-info">
                  <i class="pi pi-trash"></i>作废
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>
              </div>
            </div>
            <div *ngIf="tabIndex == 0" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableHelperNormalProductions.isLoading">
                <p-table #dataTableNormalProductions (onLazyLoad)="getTabsProduction(0,$event)"
                  [(selection)]="selectedProductsupdate" [rowHover]="true" dataKey="id"
                  [value]="primengTableHelperNormalProductions.records"
                  rows="{{primengTableHelperNormalProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableHelperNormalProductions.isResponsive"
                  resizableColumns="primengTableHelperNormalProductions.resizableColumns">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width: 3rem">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                      </th>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                            部段号
                                            <p-sortIcon field="paragraphNo"></p-sortIcon>
                                        </th>
                                        <th pSortableColumn="pageCount">
                                            页数
                                            <p-sortIcon field="pageCount"></p-sortIcon>
                                        </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>
                      <th pSortableColumn="positionName">
                        位置
                        <p-sortIcon field="positionName"></p-sortIcon>
                      </th>

                      <th style="width: 150px" pSortableColumn="creationTime">
                        分发时间
                        <p-sortIcon field="creationTime"></p-sortIcon>
                      </th>
                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                      <th pSortableColumn="remarks">
                        备注
                        <p-sortIcon field="remarks"></p-sortIcon>
                      </th>
                      <!-- <th style="width:80px">日志</th> -->
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width: 3rem">
                        <p-tableCheckbox [value]="record"></p-tableCheckbox>
                      </td>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" (click)="putIntoModal.show(record)">修改</a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="showPositionDialog(record.id,event)">日志</a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="alterationItem.show(record.fileId)">变更记录</a>
                              </li>
                            </ul>
                          </div>
                        </div>
                      </td>
                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>
                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                            <span class="ui-column-title">部段号</span>
                                            {{ record.paragraphNo}}
                                        </td>
                                        <td>
                                            <span class="ui-column-title">页数</span>
                                            {{ record.pageCount}}
                                        </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                        <span *ngIf="record.status == 9" class="m-badge m-badge--success m-badge--wide"> 传阅中</span>
                        <span *ngIf="record.status == 10" class="m-badge m-badge--metal m-badge--wide"> 传阅</span>
                        <span *ngIf="record.status == 11" class="m-badge m-badge--warning m-badge--wide"> 传阅归还</span>
                      </td>
                      <td>
                        <span class="ui-column-title">位置</span>
                        {{ record.positionName}}
                      </td>

                      <td style="width: 150px">
                        <span class="ui-column-title">分发时间</span>
                        {{ record.creationTime | momentFormat:'YYYY-MM-DD HH:mm'}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode }}
                      </td>
                      <td>
                        <span class="ui-column-title">备注</span>
                        {{ record.remarks}}
                      </td>
                      <!-- <th style="width: 80px">
                                            <p-button (click)="showPositionDialog(record.id,event)"  label="查看" styleClass="p-button-warning"></p-button>
                                         </th> -->
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableHelperNormalProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableHelperNormalProductions.defaultRecordsCountPerPage" #paginatorNormal
                    (onPageChange)="getTabsProduction(0,$event)"
                    [totalRecords]="primengTableHelperNormalProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableHelperNormalProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableHelperNormalProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>
          <tab (select)="onSelect(1)" customClass="m-tabs__item">
            <span *tabHeading>
              未接收 &nbsp;<span class='m-badge m-badge--danger'>
                {{tabsMaxCount[1]}}
              </span>
            </span>
            <div class="row margin-bottom-10">
              <div class="col-sm-12 text-left">
                <button type="button" (click)="putSelectedTechfile()"
                  [disabled]="!selectedProducts || !selectedProducts.length" class="btn btn-danger">
                  <i class="fa fa-plus-circle"></i>接收
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>

              </div>
            </div>
            <div *ngIf="tabIndex == 1" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableHelperSpecialProductions.isLoading">
                <p-table #dataTableSpecialProductions (onLazyLoad)="getTabsProduction(1,$event)"
                  [(selection)]="selectedProducts" [rowHover]="true" dataKey="id"
                  [value]="primengTableHelperSpecialProductions.records"
                  rows="{{primengTableHelperSpecialProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableHelperSpecialProductions.isResponsive"
                  resizableColumns="primengTableHelperSpecialProductions.resizableColumns">
                  <ng-template pTemplate="header">

                    <tr>
                      <th style="width: 3rem">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                      </th>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                            部段号
                                            <p-sortIcon field="paragraphNo"></p-sortIcon>
                                        </th>
                                        <th pSortableColumn="pageCount">
                                            页数
                                            <p-sortIcon field="pageCount"></p-sortIcon>
                                        </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>
                      <th style="width: 150px" pSortableColumn="creationTime">
                        分发时间
                        <p-sortIcon field="creationTime"></p-sortIcon>
                      </th>
                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width: 3rem">
                        <p-tableCheckbox [value]="record"></p-tableCheckbox>
                      </td>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" *ngIf="record.isiteffective"
                                  (click)="putIntoModal.show(record)">接收 </a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="alterationItem.show(record.fileId)">变更记录</a>
                              </li>
                            </ul>
                          </div>
                        </div>
                      </td>

                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>


                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                            <span class="ui-column-title">部段号</span>
                                            {{ record.paragraphNo}}
                                        </td>
                                        <td>
                                            <span class="ui-column-title">页数</span>
                                            {{ record.pageCount}}
                                        </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                      </td>
                      <td style="width: 150px">
                        <span class="ui-column-title">分发时间</span>
                        {{ record.creationTime | momentFormat:'YYYY-MM-DD HH:mm'}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode }}
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableHelperSpecialProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableHelperSpecialProductions.defaultRecordsCountPerPage"
                    #paginatorSpecial (onPageChange)="getTabsProduction(1,$event)"
                    [totalRecords]="primengTableHelperSpecialProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableHelperSpecialProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableHelperSpecialProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>
          <tab (select)="onSelect(2)" customClass="m-tabs__item">
            <span *tabHeading>
              待归还(更新)&nbsp;<span class='m-badge m-badge--warning'>
                {{tabsMaxCount[2]}}
              </span>
            </span>
            <div *ngIf="tabIndex == 2" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableFileTobeProductions.isLoading">
                <p-table #dataTableTobeProductions (onLazyLoad)="getTabsProduction(2,$event)"
                  [value]="primengTableFileTobeProductions.records"
                  rows="{{primengTableFileTobeProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableFileTobeProductions.isResponsive"
                  resizableColumns="primengTableFileTobeProductions.resizableColumns">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                          部段号
                                          <p-sortIcon field="paragraphNo"></p-sortIcon>
                                      </th>
                                      <th pSortableColumn="pageCount">
                                          页数
                                          <p-sortIcon field="pageCount"></p-sortIcon>
                                      </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>
                      <th pSortableColumn="positionName">
                        位置
                        <p-sortIcon field="positionName"></p-sortIcon>
                      </th>
                      <th style="width: 150px" pSortableColumn="creationTime">
                        分发时间
                        <p-sortIcon field="creationTime"></p-sortIcon>
                      </th>
                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" (click)="showPositionDialog(record.id,event)">日志</a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="alterationItem.show(record.fileId)">变更记录</a>
                              </li>
                            </ul>
                          </div>
                        </div>
                      </td>

                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>


                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                          <span class="ui-column-title">部段号</span>
                                          {{ record.paragraphNo}}
                                      </td>
                                      <td>
                                          <span class="ui-column-title">页数</span>
                                          {{ record.pageCount}}
                                      </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                        <span *ngIf="record.status == 8" class="m-badge m-badge--accent m-badge--wide"> 作废</span>
                      </td>
                      <td>
                        <span class="ui-column-title">位置</span>
                        {{ record.positionName}}
                      </td>
                      <td style="width: 150px">
                        <span class="ui-column-title">分发时间</span>
                        {{ record.creationTime | momentFormat:'YYYY-MM-DD HH:mm'}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode }}
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableFileTobeProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableFileTobeProductions.defaultRecordsCountPerPage" #paginatorTobe
                    (onPageChange)="getTabsProduction(2,$event)"
                    [totalRecords]="primengTableFileTobeProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableFileTobeProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableFileTobeProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>
          <tab (select)="onSelect(3)" customClass="m-tabs__item">
            <span *tabHeading>
              归还中 &nbsp;<span class='m-badge m-badge--info'>
                {{tabsMaxCount[3]}}
              </span>
            </span>
            <div class="row margin-bottom-10">
              <div class="col-sm-12 text-left">
                <button type="button" (click)="SelectedTechfilegh()"
                  [disabled]="!selectedProductsgh || !selectedProductsgh.length" class="btn btn-info">
                  <i class="fa la-fast-backward"></i>归还
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>

                <button type="button" (click)="SelectedTechfilejjgh()"
                  [disabled]="!selectedProductsgh || !selectedProductsgh.length" class="btn btn-danger">
                  <i class="pi pi-times"></i>拒绝
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>

              </div>
            </div>
            <div *ngIf="tabIndex == 3" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableHelperReturningProductions.isLoading">
                <p-table #dataTableReturningProductions (onLazyLoad)="getTabsProduction(3,$event)"
                  [(selection)]="selectedProductsgh" [rowHover]="true" dataKey="id"
                  [value]="primengTableHelperReturningProductions.records"
                  rows="{{primengTableHelperReturningProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableHelperReturningProductions.isResponsive"
                  resizableColumns="primengTableHelperReturningProductions.resizableColumns">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width: 3rem">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                      </th>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                          部段号
                                          <p-sortIcon field="paragraphNo"></p-sortIcon>
                                      </th>
                                      <th pSortableColumn="pageCount">
                                          页数
                                          <p-sortIcon field="pageCount"></p-sortIcon>
                                      </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>
                      <th pSortableColumn="positionName">
                        位置
                        <p-sortIcon field="positionName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width: 3rem">
                        <p-tableCheckbox [value]="record"></p-tableCheckbox>
                      </td>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" (click)="retunfile(record.id)">归还
                                </a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="refusaltoreturn(record.id)">拒绝 </a>
                              </li>

                              <li>
                                <a href="javascript:;" (click)="showPositionDialog(record.id,event)">日志</a>
                              </li>
                            </ul>
                          </div>
                        </div>
                      </td>

                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>


                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                          <span class="ui-column-title">部段号</span>
                                          {{ record.paragraphNo}}
                                      </td>
                                      <td>
                                          <span class="ui-column-title">页数</span>
                                          {{ record.pageCount}}
                                      </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                      </td>

                      <td>
                        <span class="ui-column-title">位置</span>
                        {{ record.positionName}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode}}
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableHelperReturningProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableHelperReturningProductions.defaultRecordsCountPerPage"
                    #paginatorReturning (onPageChange)="getTabsProduction(3,$event)"
                    [totalRecords]="primengTableHelperReturningProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableHelperReturningProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableHelperReturningProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>
          <tab (select)="onSelect(4)" customClass="m-tabs__item">
            <span *tabHeading>
              借出中 &nbsp;<span class='m-badge m-badge--info'>
                {{tabsMaxCount[4]}}
              </span>
            </span>
            <div class="row margin-bottom-10">
              <div class="col-sm-12 text-left">
                <button type="button" (click)="SelectedTechfilejc()"
                  [disabled]="!selectedProductsjc || !selectedProductsjc.length" class="btn btn-info">
                  <i class="fa fa-sign-out-alt"></i>借出
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>
                <button type="button" (click)="SelectedTechfilejjjc()"
                  [disabled]="!selectedProductsjc || !selectedProductsjc.length" class="btn btn-danger">
                  <i class="pi pi-times"></i>拒绝
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>
              </div>
            </div>
            <div *ngIf="tabIndex == 4" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableHelperOnloanProductions.isLoading">
                <p-table #dataTableOnloanProductions (onLazyLoad)="getTabsProduction(4,$event)"
                  [(selection)]="selectedProductsjc" [rowHover]="true" dataKey="id"
                  [value]="primengTableHelperOnloanProductions.records"
                  rows="{{primengTableHelperOnloanProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableHelperOnloanProductions.isResponsive"
                  resizableColumns="primengTableHelperOnloanProductions.resizableColumns">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width: 3rem">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                      </th>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                          部段号
                                          <p-sortIcon field="paragraphNo"></p-sortIcon>
                                      </th>
                                      <th pSortableColumn="pageCount">
                                          页数
                                          <p-sortIcon field="pageCount"></p-sortIcon>
                                      </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>
                      <th pSortableColumn="positionName">
                        位置
                        <p-sortIcon field="positionName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width: 3rem">
                        <p-tableCheckbox [value]="record"></p-tableCheckbox>
                      </td>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" (click)="lendfile(record.id)">借出
                                </a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="refusaltolend(record.id)">拒绝 </a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="showPositionDialog(record.id,event)">日志</a>
                              </li>
                            </ul>
                          </div>
                        </div>
                      </td>

                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>


                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                          <span class="ui-column-title">部段号</span>
                                          {{ record.paragraphNo}}
                                      </td>
                                      <td>
                                          <span class="ui-column-title">页数</span>
                                          {{ record.pageCount}}
                                      </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                      </td>

                      <td>
                        <span class="ui-column-title">位置</span>
                        {{ record.positionName}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode }}
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableHelperOnloanProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableHelperOnloanProductions.defaultRecordsCountPerPage" #paginatorOnloan
                    (onPageChange)="getTabsProduction(4,$event)"
                    [totalRecords]="primengTableHelperOnloanProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableHelperOnloanProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableHelperOnloanProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>
          <tab (select)="onSelect(5)" customClass="m-tabs__item">
            <span *tabHeading>
              借出 &nbsp;<span class='m-badge m-badge--metal'>
                {{tabsMaxCount[5]}}
              </span>
            </span>

            <div *ngIf="tabIndex == 5" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableFileBoorwteProductions.isLoading">
                <p-table #dataTableBoorwteProductions (onLazyLoad)="getTabsProduction(5,$event)"
                  [value]="primengTableFileBoorwteProductions.records"
                  rows="{{primengTableFileBoorwteProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableFileBoorwteProductions.isResponsive"
                  resizableColumns="primengTableFileBoorwteProductions.resizableColumns">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                          部段号
                                          <p-sortIcon field="paragraphNo"></p-sortIcon>
                                      </th>
                                      <th pSortableColumn="pageCount">
                                          页数
                                          <p-sortIcon field="pageCount"></p-sortIcon>
                                      </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>

                      <th pSortableColumn="positionName">
                        位置
                        <p-sortIcon field="positionName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                      <th style="text-align:center;">
                        借阅人
                        <input style="width:100%;" placeholder="搜索" type="text" #BorrowNameInput
                          (keyup.enter)="BorrowNameFilter(BorrowNameInput.value)">
                      </th>
                      <th>
                        借阅超期
                        <select #expireSelect (change)="BorrowExpireChange(expireSelect.value)" style="width:100%;">
                          <option value="">请选择</option>
                          <option *ngFor='let opt of ExpireSelect' [value]="opt.value">{{opt.label}}</option>
                        </select>
                      </th>
                      <!-- <th style="width:80px">日志</th> -->
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" (click)="showPositionDialog(record.id,event)">日志</a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="alterationItem.show(record.fileId)">变更记录</a>
                              </li>


                            </ul>
                          </div>
                        </div>
                      </td>
                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>
                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                          <span class="ui-column-title">部段号</span>
                                          {{ record.paragraphNo}}
                                      </td>
                                      <td>
                                          <span class="ui-column-title">页数</span>
                                          {{ record.pageCount}}
                                      </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                      </td>

                      <!-- <th style="width: 80px">
                                          <p-button (click)="showPositionDialog(record.id,event)"  label="查看" styleClass="p-button-warning"></p-button>
                                       </th> -->
                      <td>
                        <span class="ui-column-title">位置</span>
                        {{ record.positionName}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode }}
                      </td>
                      <td>
                        <span class="ui-column-title">借阅人</span>
                        {{ record.borrowUserName}}
                      </td>
                      <td>
                        <span class="ui-column-title">借阅超期</span>
                        <span *ngIf="!record.isExpire" class="m-badge m-badge--success m-badge--wide">否</span>
                        <span *ngIf="record.isExpire" class="m-badge m-badge--danger m-badge--wide">是</span>
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableFileBoorwteProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableFileBoorwteProductions.defaultRecordsCountPerPage" #paginatorBoorwte
                    (onPageChange)="getTabsProduction(5,$event)"
                    [totalRecords]="primengTableFileBoorwteProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableFileBoorwteProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableFileBoorwteProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>

          <tab (select)="onSelect(6)" customClass="m-tabs__item">
            <span *tabHeading>
              已作废 &nbsp;<span class='m-badge m-badge--metal'>
                {{tabsMaxCount[6]}}
              </span>
            </span>
            <div class="row margin-bottom-10">
              <div class="col-sm-12 text-left">
                <button type="button" (click)="SelectedTechfileVoidBack()"
                  [disabled]="!selectedProductsvoided || !selectedProductsvoided.length" class="btn btn-info">
                  <i class="fa la-fast-backward"></i>取消
                  <!-- <span class="m-badge m-badge--danger">2</span> -->
                </button>
              </div>
            </div>
            <div *ngIf="tabIndex == 6" class="row align-items-center">
              <!--<Primeng-TurboTable-Start>-->
              <div class="primeng-datatable-container" [busyIf]="primengTableFileVoidedProductions.isLoading">
                <p-table #dataTableFileVoidedProductions (onLazyLoad)="getTabsProduction(6,$event)"
                  [(selection)]="selectedProductsvoided" [rowHover]="true" dataKey="id"
                  [value]="primengTableFileVoidedProductions.records"
                  rows="{{primengTableFileVoidedProductions.defaultRecordsCountPerPage}}" [paginator]="false"
                  [lazy]="true" scrollable="true" ScrollWidth="100%"
                  responsive="primengTableFileVoidedProductions.isResponsive"
                  resizableColumns="primengTableFileVoidedProductions.resizableColumns">
                  <ng-template pTemplate="header">
                    <tr>
                      <th style="width: 3rem">
                        <p-tableHeaderCheckbox></p-tableHeaderCheckbox>
                      </th>
                      <th style="width:140px">操作</th>
                      <th pSortableColumn="techFileInfoType">
                        类型
                        <p-sortIcon field="techFileInfoType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="fileName">
                        名称
                        <p-sortIcon field="fileName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="modelName">
                        型号
                        <p-sortIcon field="modelName"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingCode">
                        图号
                        <p-sortIcon field="drawingCode"></p-sortIcon>
                      </th>
                      <th pSortableColumn="drawingName">
                        图号名称
                        <p-sortIcon field="drawingName"></p-sortIcon>
                      </th>
                      <!-- <th pSortableColumn="paragraphNo">
                                          部段号
                                          <p-sortIcon field="paragraphNo"></p-sortIcon>
                                      </th>
                                      <th pSortableColumn="pageCount">
                                          页数
                                          <p-sortIcon field="pageCount"></p-sortIcon>
                                      </th>   -->
                      <th pSortableColumn="stageType">
                        阶段
                        <p-sortIcon field="stageType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="securityType">
                        密级
                        <p-sortIcon field="securityType"></p-sortIcon>
                      </th>
                      <th pSortableColumn="status">
                        状态
                        <p-sortIcon field="status"></p-sortIcon>
                      </th>

                      <th pSortableColumn="positionName">
                        位置
                        <p-sortIcon field="positionName"></p-sortIcon>
                      </th>

                      <th pSortableColumn="alterationInvoiceCode">
                        更改单号

                      </th>
                      <!-- <th style="width:80px">日志</th> -->
                    </tr>
                  </ng-template>
                  <ng-template pTemplate="body" let-record="$implicit">
                    <tr>
                      <td style="width: 3rem">
                        <p-tableCheckbox [value]="record"></p-tableCheckbox>
                      </td>
                      <td style="width:140px">
                        <div class="text-left">
                          <div class="btn-group dropdown" dropdown container="body">
                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                              <i class="fa fa-cog"></i><span class="caret"></span>
                              {{"Actions" | localize}}
                            </button>
                            <ul class="dropdown-menu" *dropdownMenu>
                              <li>
                                <a href="javascript:;" (click)="showPositionDialog(record.id,event)">日志</a>
                              </li>
                              <li>
                                <a href="javascript:;" (click)="alterationItem.show(record.fileId)">变更记录</a>
                              </li>


                            </ul>
                          </div>
                        </div>
                      </td>
                      <td>
                        <span class="ui-column-title">类型</span>
                        <span *ngIf="record.techFileInfoType == 1"> 图纸</span>
                        <span *ngIf="record.techFileInfoType == 2"> 技术通知单 </span>
                        <span *ngIf="record.techFileInfoType == 3"> 偏离单 </span>
                        <span *ngIf="record.techFileInfoType == 4"> 质疑单 </span>
                        <span *ngIf="record.techFileInfoType == 5"> 质量通知单 </span>
                        <span *ngIf="record.techFileInfoType == 6"> 技术条件 </span>
                        <span *ngIf="record.techFileInfoType == 7"> 技术说明书 </span>
                      </td>
                      <td>
                        <span class="ui-column-title">名称</span>
                        {{ record.fileName}}
                      </td>

                      <td>
                        <span class="ui-column-title">型号</span>
                        {{ record.modelName}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号</span>
                        {{ record.drawingCode}}
                      </td>
                      <td>
                        <span class="ui-column-title">图号名称</span>
                        {{ record.drawingName}}
                      </td>
                      <!-- <td>
                                          <span class="ui-column-title">部段号</span>
                                          {{ record.paragraphNo}}
                                      </td>
                                      <td>
                                          <span class="ui-column-title">页数</span>
                                          {{ record.pageCount}}
                                      </td>  -->
                      <td>
                        <span class="ui-column-title">阶段</span>
                        <span *ngIf="record.stageType == 1" class="m-badge m-badge--success m-badge--wide"> 模态</span>
                        <span *ngIf="record.stageType == 2" class="m-badge m-badge--success m-badge--wide"> 初样</span>
                        <span *ngIf="record.stageType == 3" class="m-badge m-badge--success m-badge--wide"> 试样</span>
                        <span *ngIf="record.stageType == 4" class="m-badge m-badge--success m-badge--wide"> 定型</span>
                      </td>
                      <td>
                        <span class="ui-column-title">密级</span>
                        <span *ngIf="record.securityType == 1" class="m-badge m-badge--success m-badge--wide"> 内部</span>
                        <span *ngIf="record.securityType == 2" class="m-badge m-badge--success m-badge--wide"> 秘密</span>
                        <span *ngIf="record.securityType == 3" class="m-badge m-badge--danger m-badge--wide"> 机密</span>
                        <span *ngIf="record.securityType == 4" class="m-badge m-badge--danger m-badge--wide"> 绝密</span>

                      </td>
                      <td>
                        <span class="ui-column-title">状态</span>
                        <span *ngIf="record.status == 1" class="m-badge m-badge--success m-badge--wide"> 正常</span>
                        <span *ngIf="record.status == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
                        <span *ngIf="record.status == 3" class="m-badge m-badge--warning m-badge--wide"> 待归还</span>
                        <span *ngIf="record.status == 4" class="m-badge m-badge--danger m-badge--wide"> 待接收</span>
                        <span *ngIf="record.status == 5" class="m-badge m-badge--danger m-badge--wide"> 待更新</span>
                        <span *ngIf="record.status == 6" class="m-badge m-badge--info m-badge--wide"> 借出中</span>
                        <span *ngIf="record.status == 7" class="m-badge m-badge--info m-badge--wide"> 归还中</span>
                        <span *ngIf="record.status == 8" class="m-badge m-badge--metal m-badge--wide"> 作废</span>
                      </td>

                      <!-- <th style="width: 80px">
                                          <p-button (click)="showPositionDialog(record.id,event)"  label="查看" styleClass="p-button-warning"></p-button>
                                       </th> -->
                      <td>
                        <span class="ui-column-title">位置</span>
                        {{ record.positionName}}
                      </td>
                      <td>
                        <span class="ui-column-title">更改单号</span>
                        {{ record.alterationInvoiceCode }}
                      </td>
                    </tr>
                  </ng-template>
                </p-table>
                <div class="primeng-no-data" *ngIf="primengTableFileVoidedProductions.totalRecordsCount == 0">
                  没有数据
                </div>
                <div class="primeng-paging-container">
                  <p-paginator [rows]="primengTableFileVoidedProductions.defaultRecordsCountPerPage" #paginatorVoided
                    (onPageChange)="getTabsProduction(6,$event)"
                    [totalRecords]="primengTableFileVoidedProductions.totalRecordsCount"
                    [rowsPerPageOptions]="primengTableFileVoidedProductions.predefinedRecordsCountPerPage">
                  </p-paginator>
                  <span class="total-records-count">
                    共 {{primengTableFileVoidedProductions.totalRecordsCount}} 条
                  </span>
                </div>
              </div>
              <!--<Primeng-TurboTable-End>-->
            </div>
          </tab>
        </tabset>
      </div>
    </div>
  </div>

</div>
<!-- <p-dialog header="日志" [(visible)]="displayPosition"  [modal]="true" [style]="{width: '50vw'}" [baseZIndex]="10000"
    [draggable]="false" [resizable]="false"> -->
<p-dialog header="日志" [(visible)]="displayBasic" [style]="{width: '55vw'}" [baseZIndex]="10001">
  <div class="primeng-datatable-container" [busyIf]="primengTableHelper.isLoading">
    <p-table #dataTableFileRecordlProductions [value]="primengTableFileRecordProductions.records" emptyMessage="没有数据">
      <ng-template pTemplate="header">
        <tr>
          <th>发起时间</th>
          <th>确认时间</th>
          <th style="width: 100px;">操作</th>
          <th style="width: 100px;">结果</th>
          <th>发起人</th>
          <th>处理人</th>
        </tr>
      </ng-template>
      <ng-template pTemplate="body" let-record>
        <tr>
          <td>{{ record.creationTime | momentFormat:'YYYY-MM-DD HH:mm'}}</td>
          <td>

            <span *ngIf="record.action == 4 || record.action  == 1 || record.action  == 5 || record.action  == 6 ">
              {{ record.creationTime | momentFormat:'YYYY-MM-DD HH:mm'}}
            </span>

            <span *ngIf="record.action != 4 && record.action  != 1 && record.action  != 5 && record.action  != 6 ">
              {{ record.lastModificationTime | momentFormat:'YYYY-MM-DD HH:mm'}}
            </span>
          </td>
          <td style="width: 100px;">
            <span *ngIf="record.action  == 1" class="m-badge m-badge--success m-badge--wide"> 接收</span>
            <span *ngIf="record.action == 2" class="m-badge m-badge--metal m-badge--wide"> 借出</span>
            <span *ngIf="record.action == 3" class="m-badge m-badge--info m-badge--wide"> 归还</span>
            <span *ngIf="record.action == 4" class="m-badge m-badge--success m-badge--wide"> 分发</span>
            <span *ngIf="record.action  == 5" class="m-badge m-badge--success m-badge--wide"> 作废</span>
            <span *ngIf="record.action == 6" class="m-badge m-badge--metal m-badge--wide"> 取消作废</span>
            <span *ngIf="record.action == 7" class="m-badge m-badge--info m-badge--wide"> 传阅</span>
            <span *ngIf="record.action == 8" class="m-badge m-badge--success m-badge--wide"> 传阅归还</span>
          </td>
          <td style="width: 100px;">
            <span *ngIf="record.isiteffective" class="m-badge m-badge--success m-badge--wide"> 成功</span>
            <span
              *ngIf="!record.isiteffective && record.userName!=record.confirUserName && record.confirUserName !=null"
              class="m-badge m-badge--danger m-badge--wide"> 失败</span>

            <span
              *ngIf="!record.isiteffective && record.userName==record.confirUserName && record.confirUserName !=null"
              class="m-badge m-badge--danger m-badge--wide"> 取消</span>

          </td>
          <td>
            发起人：{{record.userName}}

          <td>
            <span *ngIf="record.action == 4 || record.action  == 1 || record.action  == 5 || record.action  == 6 ">
              处理人： {{record.userName}}</span>
            <span *ngIf="record.confirUserName!=null"> 处理人： {{record.confirUserName}} </span>
          </td>
        </tr>
      </ng-template>
    </p-table>
  </div>
  <!-- <ng-template pTemplate="footer">
            <p-button icon="pi pi-check" (click)="displayPosition=false" label="Yes" class="p-button-text"></p-button>
            <p-button icon="pi pi-times" (click)="displayPosition=false" label="No"></p-button>
        </ng-template> -->
</p-dialog>


<app-receive-techfile-modal #putIntoModal (modalSave)="reloadPage()"></app-receive-techfile-modal>
<app-putreceive-techfile-modal #putAllIntoModal (modalSave)="reloadPage()"></app-putreceive-techfile-modal>
<alterationItem #alterationItem></alterationItem>